package day08;

/*
 * Author: JacksonCoder
 * FileName: ByteStreamExample
 * Version: 1.0.0
 * Date: 2025/4/15
 */

import java.io.*;

public class ByteStreamExample {
    public static void main(String[] args) {
        try (FileInputStream fis = new FileInputStream("input.txt");
             FileOutputStream fos = new FileOutputStream("output.txt")) {
                byte[] buffer = new byte[1024];
                int len;
                while((len = fis.read(buffer)) != -1){
                    fos.write(buffer,0,len);
                }
            System.out.println("File copied successfully!!!");
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
